package com.hspedu.exception_;

/**
 * @Author Stringzhua
 * @Date 2024/3/7 21:38
 * description:
 */
public class NumberFormatException_ {
    public static void main(String[] args) {
//        String name = "1234";
        String name = "爪爪吃蒸饺";
        //将String转成int
        int num = Integer.parseInt(name);//抛出NumberFormatException异常
//        Exception in thread "main" java.lang.NumberFormatException: For input string: "爪爪吃蒸饺"
        System.out.println("num = " + num);//1234
    }
}
